-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-104: Operation classes for some commands #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
/** | ||
* @param boolean $isCursorSupported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was leftover from when the wire version check was in execute()
(before I moved it to createCommand()
).
00fe7eb
to
eda9c3c
Compare
*/ | ||
class Aggregate implements Executable | ||
{ | ||
private static $wireVersionForCursor = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before you ask, this is the closest thing to a private constant. I'd rather not have this in the public API.
eba5c16
to
f4a450e
Compare
lgtm |
ebc4ff1
to
3cb9adc
Compare
@@ -42,6 +46,7 @@ protected function getServerVersion(ReadPreference $readPreference = null) | |||
$readPreference ?: new ReadPreference(ReadPreference::RP_PRIMARY) | |||
); | |||
|
|||
$cursor->setTypeMap(array('document' => 'array')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derickr: This should address the error you were seeing.
7790bd3
to
6bdecdb
Compare
Invalid arguments and options constitute a logic error, so InvalidArgumentTypeException may be used. For runtime errors (e.g. server returned something we didn't expect), UnexpectedValueTypeException may be used.
Additionally, this changes createIndexes() to no longer allow an empty array as input. The index management spec doesn't state that empty input must be accepted, so I'm not sure why we had that behavior.
* Use BSON round-trip to normalize pipelines for comparison * Use Canonical Extended JSON * Fix $regex comparison
https://jira.mongodb.org/browse/PHPLIB-104